<div class="actions">
    <?php
    echo CHtml::link('Thêm mặt hàng mới', array('item/create'), array('class' => 'btn btn-small btn-success'));
    ?>
    <?php
    echo CHtml::link(ProductModule::t('Xem tất cả'), array('item/list'), array('class' => 'btn btn-small btn-success'));
    ?>
    <?php
    echo CHtml::link(ProductModule::t('Nhập từ file excel'), array('item/import-excel'), array('class' => 'btn btn-small btn-success'));
    ?>
    <?php
    echo CHtml::link(ProductModule::t('Tải file excel hiện có'), array('item/download-excel'), array('class' => 'btn btn-small btn-success'));
    ?>
</div>

<?php
$this->renderPartial('_searchForm', array('model' => new SearchForm()));

$this->widget('bootstrap.widgets.TbGridView', array(
    'dataProvider' => $dataProvider,
    'type' => 'striped bordered condensed',
    'columns' => array(
        array('name' => 'item_id', 'value' => '$data->item_id', 'type' => 'number', 'htmlOptions' => array(
            'style' => 'text-align: right;'
        )),
        array('name' => 'title', 'value' => '$data->title'),
        array('name' => 'code', 'value' => '$data->code', 'htmlOptions' => array(
            'style' => 'text-align: right;'
        )),
        array('name' => 'product_id', 'value' => '!empty($data->product->title)?$data->product->title:"--"'),
        array('name' => 'supplier_id', 'value' => '!empty($data->supplier->name)?$data->supplier->name:"--"'),
        array('name' => 'price', 'value' => 'Yii::app()->numberFormatter->formatCurrency($data->price, "VND")', 'type'=>'raw', 'htmlOptions' => array(
            'style' => 'text-align: right;'
        )),
        array('name' => 'quantity', 'value' => 'Yii::app()->numberFormatter->formatDecimal($data->quantity)','type'=>'raw', 'htmlOptions' => array(
            'style' => 'text-align: right;'
        )),
        array('name' => 'size', 'value' => '$data->size','type'=>'number', 'htmlOptions' => array(
            'style' => 'text-align: right;'
        )),
        array('name' => 'color', 'value' => '$data->color'),
        array('name' => 'material', 'value' => '$data->material'),
        //array('name' => 'description', 'value' => '!empty($data->description)?$data->description:"--"'),
        array(// display a column with "view", "update" and "delete" buttons
            'class' => 'CButtonColumn',
        ),
    ),
));